#include"Library.h"
int main()
{
	LibList libList;
	
	login();
	while (true)
	{
		libList.head = NULL;
		libList.bookNum = 0;
		initList(&libList);
		system("cls");
		functMenu();
		char choice[10];
		printf("请输入你的选择:");
		scanf("%s", choice);
		if (choice[0] < '0' || choice[0]>'5' || strlen(choice) != 1)
		{
			printf("\n");
			printf("你不是地球人吗?(按任意键继续执行)\n");
			getch();
		}
		int seclet = choice[0] - '0';
		switch (seclet)
		{
		case exitSystem:
			printf("输入任意键程序退出\n");
			getch();
			exit(0);
			break;
		case addBook:
			system("cls");
			functAddBook(&libList);
			printf("按任意键继续执行\n");
			getch();
			break;
		case lookBook:
			system("cls");
			functLookBook(&libList);
			printf("按任意键继续执行\n");
			getch();
			break;
		case findBook:
			system("cls");
			functFindBook(&libList);
			printf("按任意键继续执行\n");
			getch();
			break;
		case deleBook:
			system("cls");
			functDeleBook(&libList);
			printf("按任意键继续执行\n");
			getch();
			break;
		case modifyBook:
			system("cls");
			functModifyBook(&libList);
			printf("按任意键继续执行\n");
			getch();
			break;
		}
		updateFile(&libList);
	}
	return 0;
}
